//服装百货中的焦点图；
$(function(){
	//点击右箭头切换图片
	var num =0;
	$(".banner-wrapper2 .arrow-right").click(function(){
		num++;
		if(num==$(".banner-wrapper1 li").size()){
			num=1
		}
		var oWidth;
		oWidth =num* -$(".banner-wrapper1 li").width();
		$(".banner-wrapper1").animate({"left":oWidth},30);
	})
	//点击左箭头切换图片
	$(".banner-wrapper2 .arrow-left").click(function(){
		if(num<1){
			num=$(".banner-wrapper1 li").size()-1
		}num--;
		var oWidth;
		oWidth =num* -$(".banner-wrapper1 li").width();
		$(".banner-wrapper1").animate({"left":oWidth},30);
	})
	
	
	
	
	//鼠标放上去箭头显示
	$(".banner-wrapper").mouseenter(function(){
		$(".banner-wrapper2").css("display","bloack")
	})
	//鼠标移走箭头消失
	$(".banner-wrapper").mouseleave(function(){
		$(".banner-wrapper2").css("display","none");
	})
	
	
	//服装百货中的选项卡
		$(".floor1-tab li").mouseenter(function(){
			$(".floor1-tab li").eq($(this).index()).addClass("cur").siblings().removeClass('cur');
			$(".banner-map").hide().eq($(this).index()).show();
		})

	
		
})
//首屏焦点图右侧选项卡
$(function(){
	$(".cader li").mouseenter(function(){
		$(".cader li").find("span").removeClass("huang");
		$(this).find("span").addClass("huang");
		$(".cade1").hide().eq($(this).index()).show();
	})
})


//首屏焦点图
$(function(){
		var num = 0;
		var timer = null;
		var timer2 = null;
		function move(){
			num++;
			num = (num ==$("#banner1 ul li").length) ? 0 : num ;
		$("#banner1 img").eq(num ).fadeIn(500).siblings("img").fadeOut(500);
		$("#banner1 ul li").eq(num ).addClass("current").siblings("li").removeClass("current");
		}
		timer = setInterval(move,5000);
		$("#banner1 ul li").mouseenter(function(){
		var cthis = $(this);
		clearInterval(timer);
		timer2 = setTimeout(function(){
			
			num = cthis.index();
			$("#banner1 img").eq(num).stop().fadeIn(500).siblings("img").stop().fadeOut(500);
		$("#banner1 ul li").eq(num).addClass("current").siblings("li").removeClass("current");
			},200);
		});
		$("#banner1 ul li").mouseleave(function(){
			clearTimeout(timer2);
			timer = setInterval(move,5000);
		});
		
		$(".arrow a.arrow-left").mouseleave(function(){
			clearTimeout(timer2);
			timer = setInterval(move,5000);
		});
		
		$(".arrow a.arrow-left").click(function(){
		clearInterval(timer);
		clearTimeout(timer2);
		num--;
		num = (num < 0) ? $("#banner1 ul li").length-1 : num ;
		$("#banner1 img").eq(num ).fadeIn(500).siblings("img").fadeOut(500);
		$("#banner1 ul li").eq(num ).addClass("current").siblings("li").removeClass("current");
			
		});
		
		
		$(".arrow a.arrow-right").mouseleave(function(){
			clearTimeout(timer2);
			timer = setInterval(move,5000);
		});
		
		$(".arrow a.arrow-right").click(function(){
		clearInterval(timer);
		clearTimeout(timer2);
		num++;
		num = (num ==$("#banner1 ul li").length) ? 0 : num ;
		$("#banner1 img").eq(num ).fadeIn(500).siblings("img").fadeOut(500);
		$("#banner1 ul li").eq(num ).addClass("current").siblings("li").removeClass("current");		
		});
		
		//鼠标放上去显示
		$(".banner1").mouseenter(function(){
			$(".arrow").css("display","block")
		})
		$(".banner1").mouseleave(function(){
			$(".arrow").css("display","none")
		})
});
